package com.su.dolphin;

import android.app.Application;
import android.content.Context;

import com.su.dolphin.common.DpAppInfo;
import com.su.dolphin.core.AppThread;
import com.su.dolphin.model.db.DpBaseDao;
import com.su.dolphin.utils.SDCardUtils;
import com.su.dolphin.utils.mgr.DpCrashManager;

public class DpApp extends Application
{
    private static Context sContext;
    
    public static void attach(Context context) {
        sContext = context;
        init();
    }
    
    @Override
    public void onCreate() {
        super.onCreate();
        sContext = this;
        init();
        
    }
    
    private static void init() {
        SDCardUtils.init();
        DpBaseDao.init();
        DpAppInfo.init();
        AppThread.init();
        DpCrashManager.init();
    }
    
    public static Context getContext() {
        return sContext;
    }
    
}
